import request from '@/utils/request'
const prefixUrl = process.env.VUE_APP_DATA_API
/**
 * 接口地址：http://192.168.88.247:4999/web/#/214/1716
 * @description 查询项目列表
 */
export function getProjectList (params) {
  return request({
    url: '/api/v1/project/list',
    method: 'get',
    params
  })
}

/**
 * @description 新增项目
 */
export function addProject (data) {
  return request({
    url: '/api/v1/project/add',
    method: 'post',
    data
  })
}

/**
 * @description 编辑项目
 */
export function updateProject (data) {
  return request({
    url: '/api/v1/project/modify',
    method: 'put',
    data
  })
}

/**
 * @description 删除项目
 */
export function deleteProject (data) {
  return request({
    url: '/api/v1/project/delete',
    method: 'delete',
    data
  })
}

/**
 * @description 查询模块列表
 */
export function getModuleList (params) {
  return request({
    baseURL: prefixUrl,
    url: '/api/v1/project/module/list',
    method: 'get',
    params
  })
}

/**
 * @description 新增模块
 */
export function addModule (data) {
  return request({
    baseURL: prefixUrl,
    url: '/api/v1/project/module/add',
    method: 'post',
    data
  })
}

/**
 * @description 编辑模块
 */
export function updateModule (data) {
  return request({
    baseURL: prefixUrl,
    url: '/api/v1/project/module/modify',
    method: 'put',
    data
  })
}

/**
 * @description 删除模块
 */
export function deleteModule (data) {
  return request({
    baseURL: prefixUrl,
    url: '/api/v1/project/module/delete',
    method: 'delete',
    data
  })
}

/**
 * @description 查询小组列表
 */
export function getGroupList (params) {
  return request({
    baseURL: prefixUrl,
    url: '/api/v1/project/group/list',
    method: 'get',
    params
  })
}

/**
 * @description 新增小组
 */
export function addGroup (data) {
  return request({
    url: '/api/v1/project/group/add',
    method: 'post',
    data
  })
}

/**
 * @description 编辑小组
 */
export function updateGroup (data) {
  return request({
    url: '/api/v1/project/group/modify',
    method: 'put',
    data
  })
}

/**
 * @description 删除小组
 */
export function deleteGroup (data) {
  return request({
    url: '/api/v1/project/group/delete',
    method: 'delete',
    data
  })
}
